home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9203.ZIP
/
OOPASM.ZIP
/
BORDER.ASM
next >
Wrap
Assembly Source File
|
1990-07-12
|
3KB
|
132 lines
.MODEL SMALL
INCLUDE equates.inc
INCLUDE instance.inc
INCLUDE messages.inc
INCLUDE objects.inc
IF1
INCLUDE macros.mac
INCLUDE objects.mac
INCLUDE strings.mac
ENDIF
EXTRN winInstVars:NEAR
.CODE
COMMENT %
==============================================================================
Displays a window border.
=============================================================================%
disBorder PROC NEAR
call winInstVars ;Get window coordinates
pushData <cx,dx>
push cx ;Save upper left row/col
push dx ;Save lower right row/col
sub dl,cl ;Get line length
xor dh,dh ;Clear high order
mov cx,dx ;Pass line length
pop dx ;Restore lower right row/col
pop ax ;Restore upper left row/col
push ax ;Save upper left row/col
mov dl,al ;Lower row, left col
push cx ;Save line length
getInst bh,HChar,Border ;Get horizontal char
dsb1: pushData <cx,dx>
disChar dh,dl,bl,bh ;Display horizontal line char
popData <dx,cx>
inc dl ;Increment column
loop dsb1
pop cx ;Restore line length
pop dx ;Restore upper left row/col
dsb2: pushData <cx,dx>
disChar dh,dl,bl,bh ;Display horizontal line char
popData <dx,cx>
inc dl ;Increment column
loop dsb2
popData <dx,cx>
pushData <cx,dx>
push cx ;Save upper left row/col
push dx ;Save lower right row/col
push cx ;Save upper left row/col
push dx ;Save lower right row/col
pop cx ;Restore lower row/col
pop dx ;Restore upper row/col
sub ch,dh ;Get number of rows
mov cl,ch ;Move to low order
xor ch,ch ;Clear high order
push cx ;Save loop count
getInst bh,VChar ;Get horizontal char
dsb3: inc dh ;Start at next row
pushData <cx,dx>
disChar dh,dl,bl,bh ;Display vertical line char
popData <dx,cx>
loop dsb3
pop cx ;Restore loop count
pop ax ;Restore lower row/col
pop dx ;Restore upper row/col
mov dl,al ;Start at right col
dsb4: inc dh ;Start at next row
pushData <cx,dx>
disChar dh,dl,bl,bh ;Display vertical line char
popData <dx,cx>
loop dsb4
popData <dx,cx>
push dx ;Save lower right row/col
pushData <cx,dx>
getInst bh,LRChar ;Get lower right char
disChar dh,dl,bl,bh ;Display lower right char
popData <dx,cx>
mov dl,cl ;Change colum
pushData <cx,dx>
getInst bh,LLChar ;Get lower left char
disChar dh,dl,bl,bh ;Display lower left char
popData <dx,cx>
mov dx,cx ;Change row/col
pushData <cx,dx>
getInst bh,ULChar ;Get upper left char
disChar dh,dl,bl,bh ;Display upper left char
popData <dx,cx>
pop dx ;Restore lower right row/col
mov dh,ch ;Change row
getInst bh,URChar ;Get upper right char
disChar dh,dl,bl,bh ;Display upper right char
ret
disBorder ENDP
.DATA
defMsg Border,\
Refresh,\
<disBorder,,>
defObj Border,\
<>,\
<HChar,1,Nil,\
VChar,1,Nil,\
ULChar,1,Nil,\
URChar,1,Nil,\
LLChar,1,Nil,\
LRChar,1,Nil>,\
<Refresh>
END